﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Infrastructure.Annotations;

namespace WinnerCMS.Data.Mapping
{
    public partial class CounterDiaryMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.CounterDiary>
    {
        public CounterDiaryMap()
        {
            // table
            //ToTable("CMS_CounterDiaries");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.Year)
                
                .IsRequired();
            Property(t => t.Month)
                
                .IsRequired();
            Property(t => t.Day)
                
                .IsRequired();
            Property(t => t.Hour)
                
                .IsRequired();
            Property(t => t.Time)
                
                .IsRequired().HasColumnAnnotation("Index",
                new IndexAnnotation(new[] 
                            { 
                                new IndexAttribute("IX_CounterDiary",1),
                                new IndexAttribute("IX_CounterDiary_Come",1),
                                new IndexAttribute("IX_CounterDiary_Time",0),
                                new IndexAttribute("IX_CounterDiary_Page",1),
                            }));
            Property(t => t.Week)
                
                .IsRequired();
            Property(t => t.IP)
                
                .HasMaxLength(50)
                .IsOptional().HasColumnAnnotation("Index",
                new IndexAnnotation(new[] 
                            { 
                                new IndexAttribute("IX_CounterDiary_Time",1)
                            }));
            Property(t => t.Where)
                
                .HasMaxLength(250)
                .IsOptional().HasColumnAnnotation("Index",
                new IndexAnnotation(new[] 
                            { 
                                new IndexAttribute("IX_CounterDiary",0)
                            }));
            Property(t => t.Where2)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Come)
                
                .HasMaxLength(250)
                .IsOptional().HasColumnAnnotation("Index",
                new IndexAnnotation(new[] 
                            { 
                                new IndexAttribute("IX_CounterDiary_Come",0)
                            }));
            Property(t => t.Page)
                
                .HasMaxLength(250)
                .IsOptional()
                .HasColumnAnnotation("Index",
                new IndexAnnotation(new[] 
                            { 
                                new IndexAttribute("IX_CounterDiary_Page",0)
                            }));
            Property(t => t.Browser)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.OS)
                
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.Resolution)
                
                .HasMaxLength(50)
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

